#!/bin/bash
NET=172.16.80
user=root
password=Cykk2012..
for ID in 151 152 ;do
ip=$NET.$ID
expect <<EOF
set timeout 20
spawn scp -r $1  $user@$ip:~
expect {
"yes/no" { send "yes\n";exp_continue }
"password" { send "$password\n" }
}
expect eof
EOF
done
